define(['zepto', 'underscore','cube/list', 'cube/segment', 'backbone', 'cube/store'], function($, _, List, Segment, Backbone, Session){

    var Module = function(){
        
    }

    Module.loadFlightData = function() {
        // var url = window.location.href;
        // if(url.indexOf("cube-action=")>=0) {
        //     alert("这是通过跳转进入的");
        //     var result = Session.loadObject("com.csair.flightstatus/save");
        //     if(result) {
        //         alert(JSON.stringify(result));
        //     } else {
        //         alert(result);
        //     }
        //     return result;
        // } else {
        //     alert("这是直接进入模块的");
        //     return;
        // }
        return Session.loadObject("com.csair.gms.flightstatus/save");
    }

    Module.saveFlightData = function(data) {
        return Session.saveObject("com.csair.gms.flightstatus/save", data);
    }

    Module.gotoFlightStatus = function() {
        return "../com.csair.gms.flightstatus/index.html";
    }

    Module.loadFootmark= function() {
        var footmark = Session.loadObject("module-footmark");
        if(footmark && footmark.footmark) 
        {
            Session.deleteObject("module-footmark");
            return footmark.footmark;
        }
        return undefined;
    }

    Module.saveFootmark = function(footmark) {
        Session.saveObject("module-footmark", {"footmark":footmark});
    }

    return Module;
});